<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>6-3</title>
    <style>
        td {
            width: 35px;
            height: 35px;
            background-image: url(../image/原图.png);
            background-repeat: no-repeat;
        }
    </style>
</head>


<body>
    <table>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
    </table>
    <script>
        var tds = document.getElementsByTagName('td');
        for (var i = 0; i < tds.length; i++) {
            var index = i * 44;
            /*  tds[i].style.backgroundPosition = "0-" + index + "px"; */
            tds[i].style.backgroundPosition = '0' + "-" + index + "px";
        }
    </script>
</body>

</html>